Skip to content

[#238] Add contract_address filter to admin hide/unhide#242

Merged
realproject7 merged 1 commit intomainfrom
task/238-admin-contract-filter
Mar 17, 2026
Merged

[#238] Add contract_address filter to admin hide/unhide#242
realproject7 merged 1 commit intomainfrom
task/238-admin-contract-filter

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Added .eq("contract_address", STORY_FACTORY.toLowerCase()) to both admin update queries
  • Prevents hide/unhide from affecting storylines/plots on other contracts

Test plan

  • Admin hide storyline → only affects current contract's storyline
  • Admin unhide plot → only affects current contract's plot

Fixes #238

🤖 Generated with Claude Code

Scope admin moderation to current contract only, preventing
hide/unhide from affecting storylines or plots on other contracts.

Fixes #238

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The admin hide/unhide path now scopes both update queries to STORY_FACTORY.toLowerCase(), which fixes the cross-contract moderation bug described in issue #238.

Findings

  • None. The contract filter is applied to both the storyline and plot update branches in handleModeration.

Decision

Approving because the moderation writes are now limited to the current contract as required. CI was still pending at the time of review.

@realproject7 realproject7 merged commit 06308ab into main Mar 17, 2026
1 check passed
realproject7 added a commit that referenced this pull request Mar 22, 2026
P5-9a: Create lib/zap.ts with ZapPlotLink contract wrappers:
- zapPlotLinkAbi: mint, mintReverse, estimateMintCostInPlot,
  estimateMintReverseFromPlot
- getZapQuote(): quote estimation with 0.5% swap slippage buffer
- buildZapMintTx(): wagmi-compatible tx builder for payable mints

P5-9b: Add ETH/PL_TEST input selector to TradingWidget buy tab:
- Toggle between ETH (via ZapPlotLink) and PLOT (direct MCV2_Bond)
- Default: ETH when Zap is available
- ETH mode: shows ETH balance, ETH cost estimate, executes payable tx
- PLOT mode: keeps existing approve + mint flow unchanged
- Sell tab: unchanged (burn → PL_TEST)
- Trade indexing (/api/index/trade) fires for both modes
- Zap selector hidden when ZAP_PLOTLINK is zero address

Also fixes RESERVE_LABEL mainnet value: "PL_TEST" → "PLOT"

Fixes #242

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
realproject7 added a commit that referenced this pull request Mar 22, 2026
Addresses T2a review feedback:
- Replace 1:1 ETH/PLOT assumption with real V4 Quoter calls:
  - quoteExactOutputSingle for exact-output (how much ETH for N PLOT?)
  - quoteExactInputSingle for exact-input (how much PLOT for N ETH?)
- Add minTokensOut parameter to buildZapMintTx with 3% slippage
  protection for exact-input mode (was hardcoded to 0)
- Pool key computed from sorted WETH/PLOT_TOKEN addresses

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
realproject7 added a commit that referenced this pull request Mar 22, 2026
- Remove unused imports (encodeAbiParameters, decodeFunctionResult, etc.)
- Replace `as any` casts with properly typed ABI object for V4 Quoter
- Add executeZapMint() helper as requested in issue spec
- Remove unused ZapMode type import in TradingWidget

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
realproject7 added a commit that referenced this pull request Mar 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Admin hide/unhide missing contract_address filter

2 participants